//
//  UIWindow.swift
//  Documentation
//
//  Created by Toj on 2/7/23.
//

extension UIWindow {

    
    public struct Level : Hashable, Equatable, RawRepresentable {

        public init(_ rawValue: CGFloat)

        public init(rawValue: CGFloat)
    }

    
    // instantiate a UIWindow already associated with a given UIWindowScene instance, with matching frame & interface orientations.
    
    // If nil, window will not appear on any screen.
    // changing the UIWindowScene may be an expensive operation and should not be done in performance-sensitive code
    
    // Indicates whether content should drive the size of arbitrarily resizable windows (which are currently present only on macOS).
    
    // default is [UIScreen mainScreen]. changing the screen may be an expensive operation and should not be done in performance-sensitive code
    
    // default = 0.0
    
    // In apps built against the iOS 15 or tvOS 15 SDK (or later), this property returns YES if
    // the window is its scene's key window. For apps built against earlier SDKs, this property
    // returns YES if the window is the application's key window.
    
    // Default is YES. Return NO to indicate the window cannot become the key window.
    
    // Override point for subclasses. Do not call directly. Informs the window it has become the
    // key window. In apps built against the iOS 15 or tvOS 15 SDK (or later), this method will
    // be called when the window becomes its scene's key window. For apps built against earlier
    // SDKs, this method will be called when the window becomes the application's key window.
    
    // Override point for subclasses. Do not call directly. Informs the window it has resigned key
    // window status. In apps built against the iOS 15 or tvOS 15 SDK (or later), this method will
    // be called when the window resigns key in its scene. For apps built against earlier SDKs,
    // this method will be called when the window resigns key in the application.
    
    // Make the window key without changing visibility.
    
    // Convenience. Most apps call this to show a window and also make it key.
    // To make the window visible without becoming key, just use UIView's hidden property.
    
    // default is nil
    
    // called by UIApplication to dispatch events to views inside the window
    
    // can be used to convert to another window
    // pass in nil to mean screen
    
    // Posted when the window becomes visible with a nil userInfo dictionary.
    public class let didBecomeVisibleNotification: NSNotification.Name

    
    // Posted when the window becomes hidden with a nil userInfo dictionary.
    public class let didBecomeHiddenNotification: NSNotification.Name

    
    // Posted when the window becomes the key window with a nil userInfo dictionary. In apps built
    // against the iOS 15 or tvOS 15 SDK (or later), this notification will be posted when the window
    // becomes its scene's key window. For apps built against earlier SDKs, it will be posted when
    // the window becomes the application's key window.
    public class let didBecomeKeyNotification: NSNotification.Name

    
    // Posted when the window resigns key window status with a nil userInfo dictionary. In apps built
    // against the iOS 15 or tvOS 15 SDK (or later), this notification will be posted when the window
    // resigns key in its scene. For apps built against earlier SDKs, it will be posted when the window
    // resigns key in the application.
    public class let didResignKeyNotification: NSNotification.Name
}
@available(iOS 2.0, *)
open class UIWindow : UIView {

    @available(iOS 13.0, *)
    public init(windowScene: UIWindowScene)

    @available(iOS 13.0, *)
    weak open var windowScene: UIWindowScene?

    open var canResizeToFitContent: Bool

    @available(iOS 3.2, *)
    open var screen: UIScreen

    open var windowLevel: UIWindow.Level

    open var isKeyWindow: Bool { get }

    @available(iOS 15.0, *)
    open var canBecomeKey: Bool { get }

    open func becomeKey()

    open func resignKey()

    open func makeKey()

    open func makeKeyAndVisible()

    @available(iOS 4.0, *)
    open var rootViewController: UIViewController?

    open func sendEvent(_ event: UIEvent)

    open func convert(_ point: CGPoint, to window: UIWindow?) -> CGPoint

    open func convert(_ point: CGPoint, from window: UIWindow?) -> CGPoint

    open func convert(_ rect: CGRect, to window: UIWindow?) -> CGRect

    open func convert(_ rect: CGRect, from window: UIWindow?) -> CGRect
}
extension UIWindow.Level {

    public static let normal: UIWindow.Level

    public static let alert: UIWindow.Level

    public static let statusBar: UIWindow.Level
}
extension UIResponder {

    
    public class let keyboardWillShowNotification: NSNotification.Name

    public class let keyboardDidShowNotification: NSNotification.Name

    public class let keyboardWillHideNotification: NSNotification.Name

    public class let keyboardDidHideNotification: NSNotification.Name

    
    @available(iOS 3.2, *)
    public class let keyboardFrameBeginUserInfoKey: String // NSValue of CGRect

    @available(iOS 3.2, *)
    public class let keyboardFrameEndUserInfoKey: String // NSValue of CGRect

    @available(iOS 3.0, *)
    public class let keyboardAnimationDurationUserInfoKey: String // NSNumber of double

    @available(iOS 3.0, *)
    public class let keyboardAnimationCurveUserInfoKey: String // NSNumber of NSUInteger (UIViewAnimationCurve)

    @available(iOS 9.0, *)
    public class let keyboardIsLocalUserInfoKey: String // NSNumber of BOOL

    
    // Like the standard keyboard notifications above, these additional notifications include
    // a nil object and begin/end frames of the keyboard in screen coordinates in the userInfo dictionary.
    @available(iOS 5.0, *)
    public class let keyboardWillChangeFrameNotification: NSNotification.Name

    @available(iOS 5.0, *)
    public class let keyboardDidChangeFrameNotification: NSNotification.Name
}
